package com.winchain.provider.expiration.service.impl;

import com.shell.bee.acct.transaction.po.AcctTxRec;
import com.winchain.chainbill.bill.base.po.CbDfrl;
import com.winchain.chainbill.bill.base.service.CbDfrlService;
import com.winchain.provider.expiration.service.PayResultProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("expDlyInsResultProcessService")
public class ExpDlyInsResultProcessServiceImpl implements PayResultProcessService {
	@Autowired
	private CbDfrlService cbDfrlService;

	public void success(AcctTxRec tran) {
		CbDfrl cbDfrl = (CbDfrl) this.cbDfrlService.selectByKey(tran.getBizId());
		cbDfrl.setDfrlState("3");
		tran.setTxSts("S");
		process(cbDfrl, tran);
	}

	public void fail(AcctTxRec tran) {
		CbDfrl cbDfrl = (CbDfrl) this.cbDfrlService.selectByKey(tran.getBizId());
		cbDfrl.setDfrlState("2");
		tran.setTxSts("F");
		process(cbDfrl, tran);
	}

	private void process(CbDfrl cbDfrl, AcctTxRec tran) {
	}
}
